package com.qiangqiang.entity;

import javax.persistence.*;

/**
 * Created by q on 2018/4/10.
 */
@Entity
@Table(name = "class", schema = "student", catalog = "")
public class ClazzEntity {
    private int classId;
    private String major;
    private int classNumber;
    private String year;

    @Id
    @Column(name = "class_id")
    public int getClassId() {
        return classId;
    }

    public void setClassId(int classId) {
        this.classId = classId;
    }

    @Basic
    @Column(name = "major")
    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    @Basic
    @Column(name = "class_number")
    public int getClassNumber() {
        return classNumber;
    }

    public void setClassNumber(int classNumber) {
        this.classNumber = classNumber;
    }

    @Basic
    @Column(name = "year")
    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ClazzEntity that = (ClazzEntity) o;

        if (classId != that.classId) return false;
        if (classNumber != that.classNumber) return false;
        if (major != null ? !major.equals(that.major) : that.major != null) return false;
        if (year != null ? !year.equals(that.year) : that.year != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = classId;
        result = 31 * result + (major != null ? major.hashCode() : 0);
        result = 31 * result + classNumber;
        result = 31 * result + (year != null ? year.hashCode() : 0);
        return result;
    }
}
